#include <header.h>
void fun2(int num){
	printf("i am fun2\n");
}

int main(int argc, char* argv[]){

	int pipe_fd[2];
	pipe(pipe_fd);

	if(fork() == 0){
		// child
		sleep(100);
	}else{
		signal(2, fun2);

		char buf[1 << 10] = {0};
		int res = read(pipe_fd[0], buf, sizeof buf);

		printf("res:%d\n", res);


	}

	return 0;
}